#!/usr/bin/env perl
use strict;
use warnings;

my %hash;

while(my $line = <STDIN>){
	chomp($line);
	if(exists($hash{$line})){
		$hash{$line} += 1;
	} else {
		$hash{$line} = 1;
	}
}
while(my($k,$v) = each(%hash)){
	printf("%s\t%s\n",$k,$v);
}
